<template>
    <div>
        跳转后的页面
        <button @click="_sendMessage">发送消息</button>
        <button @click="toPage">跳转页面</button>
        <button @click="initBroadcast">初始化广播</button>
    </div>
</template>

<script setup>
import { onMounted, ref } from "vue"
import { useRouter } from "vue-router"
const router = useRouter()

const toPage = () => {
    console.log("跳转页面");

    router.push("/page")
}

import useTestHooks from "@/hooks/useTestHooks";

const { initBroadcast,
    sendMessage,
} = useTestHooks()


const _sendMessage = () => {
    sendMessage("发送消息")
}





onMounted(() => {
    initBroadcast()
})
</script>

<style lang="scss" scoped></style>